import request from '@/utils/request'

// 查询用户考勤记录列表
export function listAttendanceRecord(query) {
	return request({
		url: '/system/attendanceRecord/list',
		method: 'get',
		params: query
	})
}

// 查询用户考勤记录详细
export function getAttendanceRecord(id) {
	return request({
		url: '/system/attendanceRecord/' + id,
		method: 'get'
	})
}

// 新增用户考勤记录
export function addAttendanceRecord(data) {
	return request({
		url: '/system/attendanceRecord',
		method: 'post',
		data: data
	})
}

// 修改用户考勤记录
export function updateAttendanceRecord(data) {
	return request({
		url: '/system/attendanceRecord',
		method: 'put',
		data: data
	})
}

// 删除用户考勤记录
export function delAttendanceRecord(id) {
	return request({
		url: '/system/attendanceRecord/' + id,
		method: 'delete'
	})
}

//用户进场
export function userCheckIn(userId, projectId) {
	return request({
		url: '/system/attendanceRecord/userCheckIn?userId=' + userId + '&projectId=' + projectId,
		method: 'get'
	})
}

//用户进场
export function userCheckOut(userId) {
	return request({
		url: '/system/attendanceRecord/userCheckOut?userId=' + userId,
		method: 'get'
	})
}